package com.example.demo.mapper.ClickHouse;

import com.example.demo.pojo.Stock.Stock;
import org.apache.ibatis.annotations.*;

import java.time.LocalDateTime;

@Mapper
public interface ClickHouseMapper {
    @Select("SELECT id ,day_time, merchandise , market, stock_name, last, max_up, max_down, stop_reason ,max_up_down " +
            "FROM test_results " +
            "WHERE merchandise = #{stockCode} and day_time = #{time} ")
    @Results({
            @Result(property = "id", column = "id"),
            @Result(property = "dayTime", column = "day_time"),
            @Result(property = "merchandise", column = "merchandise"),
            @Result(property = "market", column = "market"),
            @Result(property = "stockName", column = "stock_name"),
            @Result(property = "last", column = "last"),
            @Result(property = "maxUp", column = "max_up"),
            @Result(property = "maxDown", column = "max_down"),
            @Result(property = "stopReason", column = "stop_reason"),
            @Result(property = "maxUpDown", column = "max_up_down")
    })
    Stock getStockInfo(@Param("stockCode") String stockCode, @Param("time") LocalDateTime time);
}

